package com.mj.http;

import java.util.Map;

import android.content.Context;

import com.mj.util.DebugLog;
import com.mj.util.Info;

public class Url {
	private final static String ctx = "http://upgoin.com/meijufront";
	public final static String socket = "ws://192.168.5.194:9999/im";
	/***
	 * 版本检测接口
	 */
	public final static String check = ctx + "/sys/version/check.json";
	/***
	 * 获取验证码接口
	 */
	public final static String vcode = ctx + "/account/vcode.json";
	/***
	 * 用户注册接口
	 */
	public final static String regist = ctx + "/account/regist.json";
	/***
	 * 用户完善信息接口
	 */
	public final static String upinfo = ctx + "/account/upinfo.json";
	/***
	 * 用户登录接口
	 */
	public final static String login = ctx + "/account/login.json";
	/***
	 * 重置密码接口
	 */
	public final static String resetpwd = ctx + "/account/resetpwd.json";
	/***
	 * 头像墙接口
	 */
	public final static String wall = ctx + "/play/wall.json";
	/***
	 * 头像墙详情
	 */
	public final static String detail = ctx + "/play/detail.json";

	/***
	 * get请求方式的公共参数拼接
	 * 
	 * @param url
	 * @return
	 */
	public static String getParams(String url, Context context) {
		if (url.contains("?")) {
			url = url + "&";
		} else {
			url = url + "?";
		}
		String client = "client=0";
		String imei = "&imei=" + Info.getID(context);
		url = url + client + imei;
		DebugLog.i("URL", url);
		return url;
	}

	/***
	 * post请求方式的公共参数拼接
	 */

	public static Map<String, Object> postParams(String url, Map<String, Object> params, Context context) {
		params.put("client", "0");
		params.put("imei", Info.getID(context));
		DebugLog.i("URL", url);
		return params;
	}
}
